import request from '@/utils/request'

export function add(data) {
  return request.post('admin/modeltablefield/add', data)
}

export function del(data) {
  return request.post('admin/modeltablefield/del', data)
}

export function edit(data) {
  return request.post('admin/modeltablefield/edit', data)
}

export function getTablePage(data) {
  return request.post('admin/modeltablefield/listPage', data)
}

export function genDbTable(data) {
  return request.post('admin/modeltablefield/genDbTable?moduleFormId=' + data.moduleFormId + '&tableName=' + data.tableName + '&tableDesc=' + data.tableDesc, data)
}

export function deleteTable(data) {
  return request.get('admin/modeltablefield/deleteTable?moduleFormId=' + data, data)
}

export function editTableNameAndTableDesc(data) {
  return request.post('admin/modeltablefield/editTableNameAndTableDesc?moduleFormId=' + data.moduleFormId + '&tableName=' + data.tableName + '&tableDesc=' + data.tableDesc, data)
}

export default {add, del, edit, genDbTable, deleteTable, editTableNameAndTableDesc, getTablePage}
